<?php require_once 'source.php';?>
<?php require_once 'config.php';?>
<?php require_once 'dao/dao_db.php';?>
<?php require_once 'dao/dao_news.php';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo SYSTITLE?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div class="wrapper">
<?php require_once 'header.php';?>
<?php 
	if($_SESSION['level']==STUDENT){
		header("LOCATION:error.php?errcode=2");
	}
?>
<div id="layout">
	<div id="leftlay"><?php require_once 'leftnav.php';?></div>
	<div id="rightlay">
		<div class="columntitle"><?php echo NEWSMANANGE?></div>
		<div class="columncontent">
			<div id="news">
				<form action="service/service_save_news.php" method="post">
					<div id="newstype">
						<?php 
							if($_SESSION['level']==TEACHER){
						?>
						<label><input type="radio" name="newstype" checked="checked" value="0"/> <span><?php ECHO GROUPNEWS?></span></label>
						<?php 
							}
							$result=get_author_right($_SESSION['userid']);
							$row=mysql_fetch_array($result);
							if($row['NEWSRIGHT']==NEWSRIGHT){
						?>
						<label><input type="radio" name="newstype" value="2"/> <span><?php ECHO JOBNEWS?></span></label>
						<?php }?>
						<label><input type="radio" name="newstype" value="3"/> <span><?php ECHO REPORTNEWS?></span></label>
						<?php 
							if($_SESSION['level']==ADMINISTRATOR){
						?>
						<label><input type="radio" name="newstype" value="2"/> <span><?php ECHO JOBNEWS?></span></label>
						<label><input type="radio" name="newstype" checked="checked" value="1"/> <span><?php ECHO STUDENTNOTICE?></span></label>
						<?php }?>
					</div>
					<div id="title">
						<h2><?php echo REPORTTITLE?></h2>
						<input type="text" name="newstitle" value=""/>
					</div>
					<div id="content">
						<h2><?php echo REPORTCONTENT?></h2>
						<textarea name="newscontent"></textarea>
					</div>
					<div id="submit"><input type="submit" value="<?php echo SUBMIT?>"/></div>
				</form>
			</div>
		</div>
	</div>
</div>
</div>
</body>
</html>
